<?php
/**
 * Created by PhpStorm.
 * User: yangfan
 * Date: 2019/12/2
 * Time: 4:28 PM
 */

namespace App\BO\Wechat\Meta;

/**
 * 微信退款元数据
 * Class WechatRefundMeta
 * @package App\BO\Wechat\Meta
 */
class WechatRefundMeta
{
    /*
    $order = [
    'out_trade_no' => '1514192025',
    'out_refund_no' => time(),
    'total_fee' => '1',
    'refund_fee' => '1',
    'refund_desc' => '测试退款haha',
    ];
    */
    /**
     * 商户订单号
     * @var string
     */
    private $outTradeNo;

    /**
     * 商户退款订单号
     * @var string
     */
    private $outRefundNo;

    /**
     * 订单金额
     * @var string
     */
    private $totalFee;

    /**
     * 退款金额
     * @var string
     */
    private $refundFee;

    /**
     * 退款原因
     * @var string
     */
    private $refundDesc = '';

    /**
     * @return string
     */
    public function getOutTradeNo(): string
    {
        return $this->outTradeNo;
    }

    /**
     * @param string $outTradeNo
     */
    public function setOutTradeNo(string $outTradeNo): void
    {
        $this->outTradeNo = $outTradeNo;
    }

    /**
     * @return string
     */
    public function getOutRefundNo(): string
    {
        return $this->outRefundNo;
    }

    /**
     * @param string $outRefundNo
     */
    public function setOutRefundNo(string $outRefundNo): void
    {
        $this->outRefundNo = $outRefundNo;
    }

    /**
     * @return string
     */
    public function getTotalFee(): string
    {
        return $this->totalFee;
    }

    /**
     * @param string $totalFee
     */
    public function setTotalFee(string $totalFee): void
    {
        $this->totalFee = $totalFee;
    }

    /**
     * @return string
     */
    public function getRefundFee(): string
    {
        return $this->refundFee;
    }

    /**
     * @param string $refundFee
     */
    public function setRefundFee(string $refundFee): void
    {
        $this->refundFee = $refundFee;
    }

    /**
     * @return string
     */
    public function getRefundDesc(): string
    {
        return $this->refundDesc;
    }

    /**
     * @param string $refundDesc
     */
    public function setRefundDesc(string $refundDesc): void
    {
        $this->refundDesc = $refundDesc;
    }

    public function toArray()
    {
        return [
            'out_trade_no' => $this->getOutTradeNo(),  // 乐杰一家的订单号
            'out_refund_no' => $this->getOutRefundNo(),  // 乐杰一家的退款申请号
            'total_fee' => $this->getTotalFee(),
            'refund_fee' => $this->getRefundFee(),
            'refund_desc' => $this->getRefundDesc(),
            'notify_url' => route('payment.wechat.refund_notify'),
        ];
    }
}
